package com.pyrsana.contact

class Address {
    
    String streetAddress
    String city
    String state
    int zipcode
    Date dateCreated
    Date lastUpdated

    static constraints = {
        streetAddress (size: 5..50, blank: false)
        city (size: 3..15, blank: false)
        state (size: 2..2, blank: false)
        zipcode (max: 99999)
    }

    static mapping = { autoTimestamp true }
    
    def String toString() {
        return streetAddress + ", " + city + ", " + state + " " + zipcode
    }
}
